/*
 * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
 * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
 */
package org.sbbs.manager;

import org.sbbs.entity.Person;
import jakarta.annotation.PostConstruct;
import java.util.List;
import lombok.extern.slf4j.Slf4j;
import org.sbbs.base.jpa.manager.BaseManager;
import org.sbbs.cfg.SbbsTenantRoutingDatasource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.sbbs.dao.PersonRepo;

/**
 * <b>描述:</b><br/><br/>
 *
 * 说明描述用途及关键点,算法等
 * <p>
 * <b>创建时间:</b> 2025年4月9日 21:49:53 <br/>
 * <b>作者:</b> Mr.FDC <fdc_messenger@126.com> <br/>
 *
 * <p>
 * <b>修改记录:</b><br/>
 * <ol>
 * <li>......</li>
 * </ol>
 */
//@Slf4j
//@Service
public interface PersonManager  extends BaseManager<Person, Long, PersonRepo> {

//    @Autowired
//    private PersonRepo personRepository;
//    @Autowired
//    private SbbsTenantRoutingDatasource wiselyTenantRoutingDatasource;
//
//    @PostConstruct
//    public void init() {
//
//        List<Person> l = personRepository.findAll();
//        for (Person person : l) {
//            log.info(person.toString());
//        }
//        List<TenantDS> tdl = new ArrayList();
//        TenantDS ds1 = new TenantDS();
//        ds1.setDriver("com.mysql.cj.jdbc.Driver");
//        ds1.setTenantkey("vmware");
//        ds1.setUrl("jdbc:mysql://127.0.0.1:3306/vmware");
//        ds1.setUsername("root");
//        ds1.setPassword("");
//        tdl.add(ds1);
//        TenantDS ds2 = new TenantDS();
//        ds2.setDriver("com.mysql.cj.jdbc.Driver");
//        ds2.setTenantkey("pivotal");
//        ds2.setUrl("jdbc:mysql://127.0.0.1:3306/pivotal");
//        ds2.setUsername("root");
//        ds2.setPassword("");
//        tdl.add(ds2);

//        this.wiselyTenantRoutingDatasource.initTenantDs(tdl);
//        this.wiselyTenantRoutingDatasource.afterPropertiesSet();
//    }
}
